Database table for Traffic Logging
To write traffic counters in a database, you must create a table with the minimal set of fields:
N | Field name | Field type | Description |
1. | filterid | smallint | Filter id (from 1 to N. In general, N is a number of filters in the filterset) |
2. | ts | int | Timestamp field (the old name is "timestamp" in TrafMeter 3.0 and TrafMeter 2.x. It was renamed in order to compatibility with other SQL Servers). It contains a time period for counters stored in this record. For example, if ts=20021124 then this record has the traffic counters for November, 24 2002. The value of the ts field is derived on the timestamp fied template. |
3. | sent | bigint | Sent bytes counter |
4. | recv | bigint | Received bytes counter |
You can use the following script to create the table in Microsoft SQL Server:
CREATE TABLE [dbo].[traffic] ( filterid smallint NOT NULL, ts int, sent bigint, recv bigint) |
The same script works on MySQL database:
CREATE TABLE traffic ( filterid smallint NOT NULL, ts int, sent bigint, recv bigint) |
The next figure shows the table for Microsoft Access: